set more off
capture log close
cd "C:\Users\Burcu Fazlıoğlu\Dropbox\UGİ\UAE\Qataraid Introduction Paper\FPA\dataverse_files"

capture log close
log using "Table 4_Heckman-Poisson Estimation Results.log",replace

use "QATARAID_PANEL_ESTIMATIONS.dta", clear

** Table 4_Heckman-Poisson Estimation Results (2014-2021)
tab year
**Model 1
heckpoisson aidinteractions L.political_interests L.mediation_new muslimmajority arableague L.ln_qatarimports_un_v2   L.ln_gdp_per_capita_WB L.ln_pop dumcovid, select (aidstatus= L.aidstatus L.political_interests L.mediation_new muslimmajority arableague L.ln_qatarimports_un_v2  L.ln_gdp_per_capita_WB L.ln_pop  dumcovid)
outreg2 using Table4.xls, bdec(4) pvalue tdec(4) asterisk(coef) drop(year*)   replace

**Model 2
heckpoisson aidinteractions L.political_interests L.mediation_new muslimmajority arableague L.ln_qatarimports_un_v2  L.lninfant L.ln_pop dumcovid , select (aidstatus= L.aidstatus L.political_interests L.mediation_new muslimmajority arableague L.ln_qatarimports_un_v2  L.lninfant L.ln_pop dumcovid )
outreg2 using Table4.xls, bdec(4) pvalue tdec(4) asterisk(coef) drop(year*)  append 

**Model 3
heckpoisson aidinteractions L.political_interests L.mediation_new qatarblockade muslimmajority arableague L.ln_qatarimports_un_v2   L.ln_gdp_per_capita_WB L.ln_pop dumcovid, select (aidstatus= L.aidstatus L.political_interests L.mediation_new qatarblockade muslimmajority arableague L.ln_qatarimports_un_v2  L.ln_gdp_per_capita_WB L.ln_pop dumcovid)
outreg2 using Table4.xls, bdec(4) pvalue tdec(4) asterisk(coef) drop(year*)  append 


**Model 4
heckpoisson aidinteractions L.political_interests L.mediation_new qatarblockade muslimmajority arableague L.ln_qatarimports_un_v2  L.lninfant L.ln_pop dumcovid, select (aidstatus= L.aidstatus L.political_interests L.mediation_new qatarblockade muslimmajority arableague L.ln_qatarimports_un_v2  L.lninfant L.ln_pop dumcovid)
outreg2 using Table4.xls, bdec(4) pvalue tdec(4) asterisk(coef) drop(year*)  append 


***to calculate Margins
quietly heckpoisson aidinteractions L.political_interests L.mediation_new muslimmajority arableague L.ln_qatarimports_un_v2   L.ln_gdp_per_capita_WB L.ln_pop dumcovid, select (aidstatus= L.aidstatus L.political_interests L.mediation_new muslimmajority arableague L.ln_qatarimports_un_v2  L.ln_gdp_per_capita_WB L.ln_pop  dumcovid)
margins, dydx(*) predict(psel) post
estimates store MarginTable4
outreg2 using MarginTable4.xls, bdec(4) pvalue tdec(4) asterisk(coef) drop(year*)   replace


quietly heckpoisson aidinteractions L.political_interests L.mediation_new muslimmajority arableague L.ln_qatarimports_un_v2  L.lninfant L.ln_pop dumcovid , select (aidstatus= L.aidstatus L.political_interests L.mediation_new muslimmajority arableague L.ln_qatarimports_un_v2  L.lninfant L.ln_pop dumcovid )
margins, dydx(*) predict(psel) post
estimates store MarginTable4
outreg2 using MarginTable4.xls, bdec(4) pvalue tdec(4) asterisk(coef) drop(year*)   append 


quietly heckpoisson aidinteractions L.political_interests L.mediation_new qatarblockade muslimmajority arableague L.ln_qatarimports_un_v2   L.ln_gdp_per_capita_WB L.ln_pop dumcovid, select (aidstatus= L.aidstatus L.political_interests L.mediation_new qatarblockade muslimmajority arableague L.ln_qatarimports_un_v2  L.ln_gdp_per_capita_WB L.ln_pop dumcovid)
margins, dydx(*) predict(psel) post
estimates store MarginTable4
outreg2 using MarginTable4.xls, bdec(4) pvalue tdec(4) asterisk(coef) drop(year*)   append


quietly heckpoisson aidinteractions L.political_interests L.mediation_new qatarblockade muslimmajority arableague L.ln_qatarimports_un_v2  L.lninfant L.ln_pop dumcovid, select (aidstatus= L.aidstatus L.political_interests L.mediation_new qatarblockade muslimmajority arableague L.ln_qatarimports_un_v2  L.lninfant L.ln_pop dumcovid)
margins, dydx(*) predict(psel) post
estimates store MarginTable4
outreg2 using MarginTable4.xls, bdec(4) pvalue tdec(4) asterisk(coef) drop(year*)   append


log close

